﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DA;
using System.Text.RegularExpressions;
using Entities;

namespace BL
{
    public class InventoryManager
    {
        public IEnumerable<ERP_Inventory> GetAllInventory()
        {
            using (dotNetivotEntities model = new dotNetivotEntities())
            {
                return model.ERP_Inventory.ToList();
            }
        }

        public bool AddInventoryItem(ERP_Inventory InventItem)
        {
            try
            {
                using (dotNetivotEntities model = new dotNetivotEntities())
                {
                    model.ERP_Inventory.AddObject(InventItem);
                    model.SaveChanges();
                }
            }
            catch
            {
                return false;
            }
            return true;
        }
    }
}